import { defineStore } from "pinia";
import { getCategoryAPI } from '@/apis/layout';
import { ref } from "vue";

export const useCategoryStore = defineStore('category', () => {
    // 导航列表数据管理

    // 存储分类列表数据
    const categoryList = ref([])
    // 获取分类列表数据
    const getCategory = async () => {
        const { data } = await getCategoryAPI()
        categoryList.value = data.result
    }

    return {
        categoryList,
        getCategory
    }
})